<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Mediamanager</title> 
		<link href="style/css/style_edit.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="style/js/jquery.js"></script>
    <script type="text/javascript" src="style/js/jq-quicksearch.js"></script>
		<script type="text/javascript" >
    
    //media manager
    selectedVignette=null;
    function updateList() {
      $("#fileList").load("<?=makeUrl("")?>&do=mediamgr",{what:"filelist"},assignVignettes);
    }   

    function assignVignettes() {
     $('.vignette').click(function(){
          if (selectedVignette!=null) selectedVignette.removeClass("selected");
          $(this).addClass("selected");
          selectedVignette=$(this);
      });
     $('#fileList div').quicksearch({ position: 'append', attached: '#searchField',  focusOnLoad: true })
    }
    function delImage(){
           frames['uploadiframe'].location.href="<?=makeUrl("")?>?do=mediamgr&what=delimage&id="+selectedVignette.attr("title");
    }
    function insertInCode() {
      if (selectedVignette!=null)
        window.parent.barre_inserer('[['+selectedVignette.attr("title")+']]',window.parent.document.myForm.content);
    }
    $(document).ready(function() {      updateList();    }); 
    </script>
</head>
<body style="overflow:hidden;margin:0;">
<div id="searchField">
</div>
<div id="fileList">
</div>
<form target="uploadiframe" method="post" enctype="multipart/form-data" action="<?=makeUrl("")?>?do=mediamgr&what=uploaded">
<div class="message"><?=$message?></div>
<input type="file" name="fichier" size="20">
<input type="hidden" name="nomFichier" value="<?=$_GET['filename']?>">
<input type="submit" name="upload" value="Envoyer">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="button" value="Supprimer" onclick="delImage();">
<input type="button" value="Insérer"   onclick="insertInCode();window.parent.closeMediamgr();">
<input type="button" value="Annuler"   onclick="window.parent.closeMediamgr();">
</form>style="display:none;"
<iframe	id="uploadiframe" name="uploadiframe" ></iframe>
</body>
</html>
